//
// Created by 束庆乐 on 2025/1/3.
//
#include "iostream"
using namespace std;

void swapInt(int& a,int& b){
    int temp = a;
    a = b;
    b = temp;
}

void swapDouble(double& a,double& b){
    double temp = a;
    a = b;
    b = temp;
}

//利用模板提供通用的交换函数
template<typename T>
void mySwap(T& a,T& b){
    T temp = a;
    a = b;
    b = temp;
}

void test(){
    int a = 10;
    int b = 20;
    mySwap(a,b);
    cout << "a=" << a << " b=" << b << endl;
    mySwap<int>(a,b);
    cout << "a=" << a << " b=" << b << endl;
}

int main096(){
    test();

    return 0;
}